import React, {useState} from 'react';
import axios from 'axios';


export function FizzBuzz() {
	const [value = 0, setValue] = useState(0);

	return <div>
		<div data-testid="result">{value}</div>
		<button onClick={() => setValue(3)}>3</button>
		<button onClick={() => setValue(5)}>5</button>
		<button data-testid="equal" onClick={async () => {
			const numberResult = await axios.get('http://localhost:8019/number/' + value);
			console.log(numberResult);
			setValue(
				numberResult.data.result,
			)
		}}>=
		</button>
	</div>;
}
